{extend name='layout'}
{block name="content"}
<div class="container-fluid">
    <div class="row">
        <div class="col-lg-12">
            <div class="card">
                <div class="card-toolbar clearfix">
                    <form class="pull-right search-bar form-inline" method="get" action="" role="form">
                        <div class="form-group">
                            <input type="text" class="form-control" value="{$request->get('name')}" name="name" placeholder="角色名称模糊搜索">
                        </div>
                        <div class="form-group">    
                            <input class="btn btn-primary m-r-5" type="submit" value="搜索"/>
                        </div>
                    </form>
                    <div class="toolbar-btn-action">
                        <a class="btn btn-primary m-r-5" data-modal="{:url('add')}" data-title="新增角色"><i class="mdi mdi-plus"></i> 新增角色</a>
                    </div>
                </div>
                <div class="card-body">

                    <div class="table-responsive">
                        <table class="table table-bordered">
                            <thead>
                                <tr>
                                    <th>编号</th>
                                    <th>名称</th>
                                    <th>创建时间</th>
                                    <th>操作</th>
                                </tr>
                            </thead>
                            <tbody>
                                <?php if (!$list->isEmpty()): foreach ($list as $item): ?>
                                <tr>
                                    <td>{$item.id}</td>
                                    <td>{$item.name}</td>
                                    <td>{$item.create_time}</td>
                                    <td>
                                        <div class="btn-group">
                                            <a class="btn btn-xs btn-primary" data-modal="{:url('edit')}?id={$item.id}" data-title="编辑" title="编辑"
                                                data-toggle="tooltip"><i class="mdi mdi-pencil"></i></a>
                                            <a class="btn btn-xs btn-warning" data-modal="{:url('auth')}?id={$item.id}" data-title="权限设置" title="权限设置"
                                                data-toggle="tooltip"><i class="mdi mdi-lock-open"></i></a>
                                            <a class="btn btn-xs btn-danger" data-action="{:url('delete')}" data-value="id={$item.id}" title="删除" data-confirm="确认删除该角色？"
                                                data-toggle="tooltip"><i class="mdi mdi-window-close"></i></a>
                                                
                                        </div>
                                    </td>
                                </tr>
                                <?php endforeach; else: ?>
                                <tr>
                                    <td colspan="4">暂无记录</td>
                                </tr>
                                <?php endif; ?>
                            </tbody>
                        </table>
                    </div>
                    {$list|raw}
                </div>
            </div>
        </div>

    </div>

</div>
{/block}